<template>
	<div class="manage_page fillcontain">
		<el-row style="height: 100%;">
	  		<el-col :span="4"  style="min-height: 100%; background-color: #324057;">
				<el-menu class="menu" :default-active="defaultActive" style="min-height: 100%; background-color: #324057;" theme="dark" router>
					<el-menu-item index="manage"><i class="el-icon-menu"></i>首页</el-menu-item>
					<el-submenu index="2">
						<template slot="title"><i class="el-icon-document"></i><span>代理商管理</span></template>
						<el-menu-item index="accountdetail">查看账户明细</el-menu-item>
					</el-submenu>
					<el-submenu index="3" v-show="adminInfo.functions.includes(2)">
						<template slot="title"><i class="el-icon-plus"></i><span>代理商客户管理</span></template>
						<el-menu-item index="addascustoms">新增客户信息</el-menu-item>
						<el-menu-item index="ascustomsList">查看客户信息</el-menu-item>
						<el-menu-item index="AsKeyInit" v-show="adminInfo.functions.includes(1)">关键字申请</el-menu-item>
						<el-menu-item index="adminList" v-show="adminInfo.functions.includes(3)">代理商预付款</el-menu-item>
						<el-menu-item index="aslogs" v-show="adminInfo.functions.includes(22)">操作日志</el-menu-item>
						<el-menu-item index="AsKeywordsList" v-show="adminInfo.functions.includes(4)">关键字申请管理</el-menu-item>
					</el-submenu>
					<el-submenu index="4" v-show="adminInfo.functions.includes(20)">
						<template slot="title"><i class="el-icon-star-on"></i><span>系统管理</span></template>
						<el-menu-item index="finance" v-show="adminInfo.functions.includes(6)">财务管理</el-menu-item>
						<el-menu-item index="roles" v-show="adminInfo.functions.includes(7)">角色管理</el-menu-item>
						<el-menu-item index="rolePermissionConfiguration" v-show="adminInfo.functions.includes(8)">角色权限配置</el-menu-item>
						<el-menu-item index="users" v-show="adminInfo.functions.includes(9)">用户管理</el-menu-item>
						<el-menu-item index="audit" v-show="adminInfo.functions.includes(23)">关键字审核</el-menu-item>
					</el-submenu>
					<el-submenu index="5" v-show="adminInfo.functions.includes(18)">
						<template slot="title"><i class="el-icon-edit"></i><span>门户管理</span></template>
                        <el-menu-item index="portalList">门户列表</el-menu-item>
                        <el-menu-item index="lookPortal">查看门户</el-menu-item>
                        <el-menu-item index="editPortal">修改门户</el-menu-item>
					</el-submenu>
					<el-submenu index="6" v-show="adminInfo.functions.includes(21)">
						<template slot="title"><i class="el-icon-setting"></i><span>系统配置管理</span></template>
						<el-menu-item index="financialManagement" v-show="adminInfo.functions.includes(10)">财务类型</el-menu-item>
                        <el-menu-item index="serviceType" v-show="adminInfo.functions.includes(11)">服务类型</el-menu-item>
						<el-menu-item index="lengthOfService" v-show="adminInfo.functions.includes(12)">服务年限</el-menu-item>
                        <el-menu-item index="appAddress" v-show="adminInfo.functions.includes(13)">APP地址</el-menu-item>
                        <el-menu-item index="customerType" v-show="adminInfo.functions.includes(14)">客户类型</el-menu-item>
                        <el-menu-item index="certificateType" v-show="adminInfo.functions.includes(15)">证件类型</el-menu-item>
                        <el-menu-item index="preferentialType" v-show="adminInfo.functions.includes(16)">优惠类型</el-menu-item>
					</el-submenu>
					<el-submenu index="7" v-show="adminInfo.functions.includes(19)">
						<template slot="title"><i class="el-icon-star-on"></i><span>报表管理</span></template>
						<el-menu-item index="statementManage">报表管理</el-menu-item>
					</el-submenu>
				</el-menu>
			</el-col>
			<el-col :span="20" style="height: 100%;overflow: auto;">
				<keep-alive>
				    <router-view></router-view>
				</keep-alive>
			</el-col>
		</el-row>
  	</div>
</template>

<script>
    import {mapMutations, mapState} from 'vuex'
    export default {
		computed: {
            ...mapState(['adminInfo']),
			defaultActive: function(){
				return this.$route.path.replace('/', '');
			}
		},
    }
</script>


<style lang="less" scoped>
	@import '../style/mixin';
	.manage_page{

	}
    .menu *{
        color: #0082E6;
    }

</style>
